package com.bookRecommend.mapper;


import com.bookRecommend.model.Admin;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
* @author Administrator
* @description 针对表【admin(管理员表)】的数据库操作Mapper
* @createDate 2022-07-20 20:56:59
* @Entity generator.domain.Admin
*/
public interface IAdminMapper {

    @Select("select * from admin")
    List<Admin> selectAllAdmin();

    @Select("select * from admin where username = #{username} and password = #{password}")
    Admin selectByUserNameAnaPassword(Admin admin);

    @Insert("insert into admin(username, password) values(#{username}, #{password})")
    int insertAdmin(Admin admin);

    @Delete("delete from admin where id= #{id}")
    int deleteAdminById(Integer id);

    @Update("update admin set password = #{arg0} where id = #{arg1}")
    int update(String password, Integer id);
}




